#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date    : 2014-10-20 20:36:44
# @Author  : rwecho
# @Link    : http://example.org
# @Version : $Id$

import web, datetime

db = web.database(dbn='sqlite', db='blog.s3db')
db.text_factory = bytes


def get_posts():
	return db.select('blog', order='id DESC')

def new_post(title, subtitle, image, content,rdate):
	db.insert('blog', Title = title, Subtitle = subtitle, Image = image, Content = content,RDate = rdate)